<?php
class smarty_ext_guest {

	function get_lang_status($params){
		global $smarty_ext;
		return $smarty_ext->get_lang_status($params);
	}
	
	function get_client_fiels(){
		global $smarty_ext;
		return $smarty_ext->get_client_fiels();
	}
	
	function get_client_info($params){
		global $smarty_ext;
		$params['class'] = "clients";
		$params['func'] = "get_clients_info_by_id";
		return $smarty_ext->class_function($params);
	}
	
	function get_comments_fields($params){
		global $smarty_ext;
		return $smarty_ext->get_comments_fields($params);
	}
	
	function get_comments($params){
		global $smarty_ext;
		return $smarty_ext->get_comments($params);
	}
	
	function is_have_comments($params){
		global $smarty_ext;
		return $smarty_ext->is_have_comments($params);
	}
	
	function get_data($params){
		global $smarty_ext;
		return $smarty_ext->get_data($params);
	}	
	
	function get_page_info($params){
		global $smarty_ext;
		return $smarty_ext->get_page_info($params);
	}	
	
	function clear_cart(){
		global $smarty_ext;
		$params['class'] = "shopcart";
		$params['func'] = "clear_cart";
		return $smarty_ext->class_function($params);
	}
	
	function get_cart(){
		global $smarty_ext;
		$params['class'] = "shopcart";
		$params['func'] = "get_cart";
		return $smarty_ext->class_function($params);
	}
	
	function get_childs($params){
		global $smarty_ext, $tree;
		if (isset($params['id'])){
			$params1['id'] = $params['id'];
			if (isset($params1['array'])) $params1['array'] = $params['array'];
			else $params1['array'] = $tree;
			return $smarty_ext->tree_get_childs($params1);
		}
	}	
	
	function get_elements($params){
		global $smarty_ext;
		return $smarty_ext->tree_get_element($params);
	}	
	
	function get_elements_with_content ($params){
		global $treeclass;
		if (!isset($params['id'])) return false;
		if (isset($params['hide']) && ($params['hide'] == 0)) return $treeclass->_get_page_elements_with_content($params['id']);
		else return $treeclass->_get_page_elements_with_content($params['id'], 1);
	}
	
	function get_binary_data($params){
		global $smarty_ext;
		return $smarty_ext->get_binary_data($params);
	}	
	
	function count ($params) {
		if (isset($params['array']) && is_array($params['array'])) return count($params['array']);
		else return 0;
	}
	
	function array_reverse ($params) {
		if (isset($params['array']) && is_array($params['array'])) return array_reverse($params['array']);
	}
	
	function tree_get_last_child ($params){
		if ((isset($params['tree'])) && (is_array($params['tree'])) && (count($params['tree']) > 0) && (isset($params['parent']))){
			$last = array();
			foreach ($params['tree'] as $key=>$value) {
				if($value['parent']['id']==$params['parent']) $last=$value;			
			}
			return $last;
		}
	}
	
	function tree_get_first_child ($params){
		if ((isset($params['tree'])) && (is_array($params['tree'])) && (count($params['tree']) > 0) && (isset($params['parent']))){
			foreach ($params['tree'] as $key=>$value) {
				if($value['parent']['id']==$params['parent']) return $last=$value;			
			}
		}
	}
	
	function paging ($params) {
		global $smarty_ext;
		return $smarty_ext->paging($params);
	}

	function get_site_settings() {
		global $smarty_ext;
		return $smarty_ext->get_site_settings();
	}
	
	function get_form_by_parent_id($params){
		global $smarty_ext;
		return $smarty_ext->get_form_by_parent_id($params);
	}
	
	function block($params){
		global $smarty_ext;
		return $smarty_ext->block($params);
	}
	
	function get_path(){
		global $smarty_ext;
		return $smarty_ext->get_path();
	}
	
	function aasort($params){
		global $smarty_ext;
		return $smarty_ext->aasort($params);
	}
	
	function interval($params){
		global $smarty_ext;
		return $smarty_ext->interval($params);
	}
	
	function get_super_select($params){
		global $smarty_ext;
		return $smarty_ext->get_super_select($params);
	}
}
?>